package com.xuwang.Util;

import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeFormatUtils {
    public static Timestamp xgsj(String time) throws ParseException {

//            time= "2012-02-21T13:21:59";
            SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
            Date d = f.parse(time);
            Timestamp ts = new Timestamp(d.getTime());
            System.out.println(ts);

        return ts;
    }

    public static void main(String[] args) throws ParseException {
       TimeFormatUtils.xgsj("2021-09-05T16:00:00.000Z");

    }
}
